3.2.62 \(\int \frac {\tanh ^2(c+d x)}{(a+b \text {sech}^2(c+d x))^3} \, dx\) [162]

Optimal. Leaf size=139 \[ \frac {x}{a^3}-\frac {\left (3 a^2+12 a b+8 b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a+b}}\right )}{8 a^3 \sqrt {b} (a+b)^{3/2} d}-\frac {\tanh (c+d x)}{4 a d \left (a+b-b \tanh ^2(c+d x)\right )^2}-\frac {(3 a+4 b) \tanh (c+d x)}{8 a^2 (a+b) d \left (a+b-b \tanh ^2(c+d x)\right )} \]

[Out]

x/a^3-1/8*(3*a^2+12*a*b+8*b^2)*arctanh(b^(1/2)*tanh(d*x+c)/(a+b)^(1/2))/a^3/(a+b)^(3/2)/d/b^(1/2)-1/4*tanh(d*x
+c)/a/d/(a+b-b*tanh(d*x+c)^2)^2-1/8*(3*a+4*b)*tanh(d*x+c)/a^2/(a+b)/d/(a+b-b*tanh(d*x+c)^2)

________________________________________________________________________________________

Rubi [A]
time = 0.18, antiderivative size = 139, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {4226, 2000, 482, 541, 536, 212, 214} \begin {gather*} \frac {x}{a^3}-\frac {(3 a+4 b) \tanh (c+d x)}{8 a^2 d (a+b) \left (a-b \tanh ^2(c+d x)+b\right )}-\frac {\left (3 a^2+12 a b+8 b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a+b}}\right )}{8 a^3 \sqrt {b} d (a+b)^{3/2}}-\frac {\tanh (c+d x)}{4 a d \left (a-b \tanh ^2(c+d x)+b\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tanh[c + d*x]^2/(a + b*Sech[c + d*x]^2)^3,x]

[Out]

x/a^3 - ((3*a^2 + 12*a*b + 8*b^2)*ArcTanh[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a + b]])/(8*a^3*Sqrt[b]*(a + b)^(3/2)*d
) - Tanh[c + d*x]/(4*a*d*(a + b - b*Tanh[c + d*x]^2)^2) - ((3*a + 4*b)*Tanh[c + d*x])/(8*a^2*(a + b)*d*(a + b
- b*Tanh[c + d*x]^2))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 482

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[e^(n - 1
)*(e*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(n*(b*c - a*d)*(p + 1))), x] - Dist[e^n/(n*(b*c -
 a*d)*(p + 1)), Int[(e*x)^(m - n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(m - n + 1) + d*(m + n*(p + q + 1)
+ 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1] && GeQ[n
, m - n + 1] && GtQ[m - n + 1, 0] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 536

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 541

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)), x_Symbol] :> Simp[(
-(b*e - a*f))*x*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(a*n*(b*c - a*d)*(p + 1))), x] + Dist[1/(a*n*(b*c - a
*d)*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(b*e - a*f) + e*n*(b*c - a*d)*(p + 1) + d*(b*e - a*
f)*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, q}, x] && LtQ[p, -1]

Rule 2000

Int[(u_)^(p_.)*(v_)^(q_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*ExpandToSum[u, x]^p*ExpandToSum[v, x]^q
, x] /; FreeQ[{e, m, p, q}, x] && BinomialQ[{u, v}, x] && EqQ[BinomialDegree[u, x] - BinomialDegree[v, x], 0]
&&  !BinomialMatchQ[{u, v}, x]

Rule 4226

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(d*ff*x)^m*((a + b*(1 + ff^2*x^2)^(n/2))^p/(1 + ff^2
*x^2)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] && IntegerQ[n/2] && (IntegerQ[m/2] ||
EqQ[n, 2])

Rubi steps

\begin {align*} \int \frac {\tanh ^2(c+d x)}{\left (a+b \text {sech}^2(c+d x)\right )^3} \, dx &=\frac {\text {Subst}\left (\int \frac {x^2}{\left (1-x^2\right ) \left (a+b \left (1-x^2\right )\right )^3} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {x^2}{\left (1-x^2\right ) \left (a+b-b x^2\right )^3} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=-\frac {\tanh (c+d x)}{4 a d \left (a+b-b \tanh ^2(c+d x)\right )^2}+\frac {\text {Subst}\left (\int \frac {1+3 x^2}{\left (1-x^2\right ) \left (a+b-b x^2\right )^2} \, dx,x,\tanh (c+d x)\right )}{4 a d}\\ &=-\frac {\tanh (c+d x)}{4 a d \left (a+b-b \tanh ^2(c+d x)\right )^2}-\frac {(3 a+4 b) \tanh (c+d x)}{8 a^2 (a+b) d \left (a+b-b \tanh ^2(c+d x)\right )}-\frac {\text {Subst}\left (\int \frac {-5 a-4 b+(-3 a-4 b) x^2}{\left (1-x^2\right ) \left (a+b-b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{8 a^2 (a+b) d}\\ &=-\frac {\tanh (c+d x)}{4 a d \left (a+b-b \tanh ^2(c+d x)\right )^2}-\frac {(3 a+4 b) \tanh (c+d x)}{8 a^2 (a+b) d \left (a+b-b \tanh ^2(c+d x)\right )}+\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{a^3 d}-\frac {\left (3 a^2+12 a b+8 b^2\right ) \text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\tanh (c+d x)\right )}{8 a^3 (a+b) d}\\ &=\frac {x}{a^3}-\frac {\left (3 a^2+12 a b+8 b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a+b}}\right )}{8 a^3 \sqrt {b} (a+b)^{3/2} d}-\frac {\tanh (c+d x)}{4 a d \left (a+b-b \tanh ^2(c+d x)\right )^2}-\frac {(3 a+4 b) \tanh (c+d x)}{8 a^2 (a+b) d \left (a+b-b \tanh ^2(c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(1317\) vs. \(2(139)=278\).
time = 9.55, size = 1317, normalized size = 9.47 \begin {gather*} \frac {(a+2 b+a \cosh (2 (c+d x)))^3 \text {sech}^6(c+d x) \left (\frac {6 a (a+2 b) \tanh ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a+b}}\right )}{(a+b)^{5/2}}-\frac {4 \left (3 a^2+8 a b+8 b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a+b}}\right )}{(a+b)^{5/2}}+\frac {4 a \sqrt {b} \left (3 a^2+16 a b+16 b^2+3 a (a+2 b) \cosh (2 (c+d x))\right ) \sinh (2 (c+d x))}{(a+b)^2 (a+2 b+a \cosh (2 (c+d x)))^2}-\frac {2 \sqrt {b} \left (3 a^3+14 a^2 b+24 a b^2+16 b^3+a \left (3 a^2+4 a b+4 b^2\right ) \cosh (2 (c+d x))\right ) \sinh (2 (c+d x))}{(a+b)^2 (a+2 b+a \cosh (2 (c+d x)))^2}+\frac {\sqrt {b} \left (-\frac {2 \left (3 a^5-10 a^4 b+80 a^3 b^2+480 a^2 b^3+640 a b^4+256 b^5\right ) \tanh ^{-1}\left (\frac {\text {sech}(d x) (\cosh (2 c)-\sinh (2 c)) ((a+2 b) \sinh (d x)-a \sinh (2 c+d x))}{2 \sqrt {a+b} \sqrt {b (\cosh (c)-\sinh (c))^4}}\right ) (\cosh (2 c)-\sinh (2 c))}{\sqrt {a+b} \sqrt {b (\cosh (c)-\sinh (c))^4}}+\frac {\text {sech}(2 c) \left (256 b^2 (a+b)^2 \left (3 a^2+8 a b+8 b^2\right ) d x \cosh (2 c)+512 a b^2 (a+b)^2 (a+2 b) d x \cosh (2 d x)+128 a^4 b^2 d x \cosh (2 (c+2 d x))+256 a^3 b^3 d x \cosh (2 (c+2 d x))+128 a^2 b^4 d x \cosh (2 (c+2 d x))+512 a^4 b^2 d x \cosh (4 c+2 d x)+2048 a^3 b^3 d x \cosh (4 c+2 d x)+2560 a^2 b^4 d x \cosh (4 c+2 d x)+1024 a b^5 d x \cosh (4 c+2 d x)+128 a^4 b^2 d x \cosh (6 c+4 d x)+256 a^3 b^3 d x \cosh (6 c+4 d x)+128 a^2 b^4 d x \cosh (6 c+4 d x)-9 a^6 \sinh (2 c)+12 a^5 b \sinh (2 c)+684 a^4 b^2 \sinh (2 c)+2880 a^3 b^3 \sinh (2 c)+5280 a^2 b^4 \sinh (2 c)+4608 a b^5 \sinh (2 c)+1536 b^6 \sinh (2 c)+9 a^6 \sinh (2 d x)-14 a^5 b \sinh (2 d x)-608 a^4 b^2 \sinh (2 d x)-2112 a^3 b^3 \sinh (2 d x)-2560 a^2 b^4 \sinh (2 d x)-1024 a b^5 \sinh (2 d x)+3 a^6 \sinh (2 (c+2 d x))-12 a^5 b \sinh (2 (c+2 d x))-204 a^4 b^2 \sinh (2 (c+2 d x))-384 a^3 b^3 \sinh (2 (c+2 d x))-192 a^2 b^4 \sinh (2 (c+2 d x))-3 a^6 \sinh (4 c+2 d x)+10 a^5 b \sinh (4 c+2 d x)+304 a^4 b^2 \sinh (4 c+2 d x)+1056 a^3 b^3 \sinh (4 c+2 d x)+1280 a^2 b^4 \sinh (4 c+2 d x)+512 a b^5 \sinh (4 c+2 d x)\right )}{(a+2 b+a \cosh (2 (c+d x)))^2}\right )}{a^3 (a+b)^2}+\frac {2 \sqrt {b} \left (\frac {6 a^2 \tanh ^{-1}\left (\frac {\text {sech}(d x) (\cosh (2 c)-\sinh (2 c)) ((a+2 b) \sinh (d x)-a \sinh (2 c+d x))}{2 \sqrt {a+b} \sqrt {b (\cosh (c)-\sinh (c))^4}}\right ) (\cosh (2 c)-\sinh (2 c))}{\sqrt {a+b} \sqrt {b (\cosh (c)-\sinh (c))^4}}+\frac {a \text {sech}(2 c) \left (\left (-9 a^4-16 a^3 b+48 a^2 b^2+128 a b^3+64 b^4\right ) \sinh (2 d x)+a \left (-3 a^3+2 a^2 b+24 a b^2+16 b^3\right ) \sinh (2 (c+2 d x))+\left (3 a^4-64 a^2 b^2-128 a b^3-64 b^4\right ) \sinh (4 c+2 d x)\right )+\left (9 a^5+18 a^4 b-64 a^3 b^2-256 a^2 b^3-320 a b^4-128 b^5\right ) \tanh (2 c)}{a^2 (a+2 b+a \cosh (2 (c+d x)))^2}\right )}{(a+b)^2}\right )}{4096 b^{5/2} d \left (a+b \text {sech}^2(c+d x)\right )^3} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[Tanh[c + d*x]^2/(a + b*Sech[c + d*x]^2)^3,x]

[Out]

((a + 2*b + a*Cosh[2*(c + d*x)])^3*Sech[c + d*x]^6*((6*a*(a + 2*b)*ArcTanh[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a + b]
])/(a + b)^(5/2) - (4*(3*a^2 + 8*a*b + 8*b^2)*ArcTanh[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a + b]])/(a + b)^(5/2) + (4
*a*Sqrt[b]*(3*a^2 + 16*a*b + 16*b^2 + 3*a*(a + 2*b)*Cosh[2*(c + d*x)])*Sinh[2*(c + d*x)])/((a + b)^2*(a + 2*b
+ a*Cosh[2*(c + d*x)])^2) - (2*Sqrt[b]*(3*a^3 + 14*a^2*b + 24*a*b^2 + 16*b^3 + a*(3*a^2 + 4*a*b + 4*b^2)*Cosh[
2*(c + d*x)])*Sinh[2*(c + d*x)])/((a + b)^2*(a + 2*b + a*Cosh[2*(c + d*x)])^2) + (Sqrt[b]*((-2*(3*a^5 - 10*a^4
*b + 80*a^3*b^2 + 480*a^2*b^3 + 640*a*b^4 + 256*b^5)*ArcTanh[(Sech[d*x]*(Cosh[2*c] - Sinh[2*c])*((a + 2*b)*Sin
h[d*x] - a*Sinh[2*c + d*x]))/(2*Sqrt[a + b]*Sqrt[b*(Cosh[c] - Sinh[c])^4])]*(Cosh[2*c] - Sinh[2*c]))/(Sqrt[a +
 b]*Sqrt[b*(Cosh[c] - Sinh[c])^4]) + (Sech[2*c]*(256*b^2*(a + b)^2*(3*a^2 + 8*a*b + 8*b^2)*d*x*Cosh[2*c] + 512
*a*b^2*(a + b)^2*(a + 2*b)*d*x*Cosh[2*d*x] + 128*a^4*b^2*d*x*Cosh[2*(c + 2*d*x)] + 256*a^3*b^3*d*x*Cosh[2*(c +
 2*d*x)] + 128*a^2*b^4*d*x*Cosh[2*(c + 2*d*x)] + 512*a^4*b^2*d*x*Cosh[4*c + 2*d*x] + 2048*a^3*b^3*d*x*Cosh[4*c
 + 2*d*x] + 2560*a^2*b^4*d*x*Cosh[4*c + 2*d*x] + 1024*a*b^5*d*x*Cosh[4*c + 2*d*x] + 128*a^4*b^2*d*x*Cosh[6*c +
 4*d*x] + 256*a^3*b^3*d*x*Cosh[6*c + 4*d*x] + 128*a^2*b^4*d*x*Cosh[6*c + 4*d*x] - 9*a^6*Sinh[2*c] + 12*a^5*b*S
inh[2*c] + 684*a^4*b^2*Sinh[2*c] + 2880*a^3*b^3*Sinh[2*c] + 5280*a^2*b^4*Sinh[2*c] + 4608*a*b^5*Sinh[2*c] + 15
36*b^6*Sinh[2*c] + 9*a^6*Sinh[2*d*x] - 14*a^5*b*Sinh[2*d*x] - 608*a^4*b^2*Sinh[2*d*x] - 2112*a^3*b^3*Sinh[2*d*
x] - 2560*a^2*b^4*Sinh[2*d*x] - 1024*a*b^5*Sinh[2*d*x] + 3*a^6*Sinh[2*(c + 2*d*x)] - 12*a^5*b*Sinh[2*(c + 2*d*
x)] - 204*a^4*b^2*Sinh[2*(c + 2*d*x)] - 384*a^3*b^3*Sinh[2*(c + 2*d*x)] - 192*a^2*b^4*Sinh[2*(c + 2*d*x)] - 3*
a^6*Sinh[4*c + 2*d*x] + 10*a^5*b*Sinh[4*c + 2*d*x] + 304*a^4*b^2*Sinh[4*c + 2*d*x] + 1056*a^3*b^3*Sinh[4*c + 2
*d*x] + 1280*a^2*b^4*Sinh[4*c + 2*d*x] + 512*a*b^5*Sinh[4*c + 2*d*x]))/(a + 2*b + a*Cosh[2*(c + d*x)])^2))/(a^
3*(a + b)^2) + (2*Sqrt[b]*((6*a^2*ArcTanh[(Sech[d*x]*(Cosh[2*c] - Sinh[2*c])*((a + 2*b)*Sinh[d*x] - a*Sinh[2*c
 + d*x]))/(2*Sqrt[a + b]*Sqrt[b*(Cosh[c] - Sinh[c])^4])]*(Cosh[2*c] - Sinh[2*c]))/(Sqrt[a + b]*Sqrt[b*(Cosh[c]
 - Sinh[c])^4]) + (a*Sech[2*c]*((-9*a^4 - 16*a^3*b + 48*a^2*b^2 + 128*a*b^3 + 64*b^4)*Sinh[2*d*x] + a*(-3*a^3
+ 2*a^2*b + 24*a*b^2 + 16*b^3)*Sinh[2*(c + 2*d*x)] + (3*a^4 - 64*a^2*b^2 - 128*a*b^3 - 64*b^4)*Sinh[4*c + 2*d*
x]) + (9*a^5 + 18*a^4*b - 64*a^3*b^2 - 256*a^2*b^3 - 320*a*b^4 - 128*b^5)*Tanh[2*c])/(a^2*(a + 2*b + a*Cosh[2*
(c + d*x)])^2)))/(a + b)^2))/(4096*b^(5/2)*d*(a + b*Sech[c + d*x]^2)^3)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(334\) vs. \(2(125)=250\).
time = 2.61, size = 335, normalized size = 2.41

method result size
derivativedivides \(\frac {\frac {\frac {2 \left (\left (-\frac {5}{8} a^{2}-\frac {1}{2} a b \right ) \left (\tanh ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a \left (15 a^{2}+15 a b -4 b^{2}\right ) \left (\tanh ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 \left (a +b \right )}-\frac {a \left (15 a^{2}+15 a b -4 b^{2}\right ) \left (\tanh ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 \left (a +b \right )}+\left (-\frac {5}{8} a^{2}-\frac {1}{2} a b \right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (a \left (\tanh ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+b \left (\tanh ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 a \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 b \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b \right )^{2}}+\frac {2 \left (3 a^{2}+12 a b +8 b^{2}\right ) \left (-\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}\right )}{8 a +8 b}}{a^{3}}-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{3}}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{3}}}{d}\) \(335\)
default \(\frac {\frac {\frac {2 \left (\left (-\frac {5}{8} a^{2}-\frac {1}{2} a b \right ) \left (\tanh ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a \left (15 a^{2}+15 a b -4 b^{2}\right ) \left (\tanh ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 \left (a +b \right )}-\frac {a \left (15 a^{2}+15 a b -4 b^{2}\right ) \left (\tanh ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 \left (a +b \right )}+\left (-\frac {5}{8} a^{2}-\frac {1}{2} a b \right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (a \left (\tanh ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+b \left (\tanh ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 a \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 b \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b \right )^{2}}+\frac {2 \left (3 a^{2}+12 a b +8 b^{2}\right ) \left (-\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}\right )}{8 a +8 b}}{a^{3}}-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{3}}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{3}}}{d}\) \(335\)
risch \(\frac {x}{a^{3}}+\frac {5 a^{3} {\mathrm e}^{6 d x +6 c}+20 a^{2} b \,{\mathrm e}^{6 d x +6 c}+16 a \,b^{2} {\mathrm e}^{6 d x +6 c}+15 a^{3} {\mathrm e}^{4 d x +4 c}+58 a^{2} b \,{\mathrm e}^{4 d x +4 c}+88 a \,b^{2} {\mathrm e}^{4 d x +4 c}+48 b^{3} {\mathrm e}^{4 d x +4 c}+15 a^{3} {\mathrm e}^{2 d x +2 c}+44 a^{2} b \,{\mathrm e}^{2 d x +2 c}+32 a \,b^{2} {\mathrm e}^{2 d x +2 c}+5 a^{3}+6 a^{2} b}{4 a^{3} d \left (a \,{\mathrm e}^{4 d x +4 c}+2 a \,{\mathrm e}^{2 d x +2 c}+4 b \,{\mathrm e}^{2 d x +2 c}+a \right )^{2} \left (a +b \right )}+\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}+2 a b +2 b^{2}}{a \sqrt {a b +b^{2}}}\right )}{16 \sqrt {a b +b^{2}}\, \left (a +b \right ) d a}+\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}+2 a b +2 b^{2}}{a \sqrt {a b +b^{2}}}\right ) b}{4 \sqrt {a b +b^{2}}\, \left (a +b \right ) d \,a^{2}}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}+2 a b +2 b^{2}}{a \sqrt {a b +b^{2}}}\right ) b^{2}}{2 \sqrt {a b +b^{2}}\, \left (a +b \right ) d \,a^{3}}-\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}-2 a b -2 b^{2}}{a \sqrt {a b +b^{2}}}\right )}{16 \sqrt {a b +b^{2}}\, \left (a +b \right ) d a}-\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}-2 a b -2 b^{2}}{a \sqrt {a b +b^{2}}}\right ) b}{4 \sqrt {a b +b^{2}}\, \left (a +b \right ) d \,a^{2}}-\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}-2 a b -2 b^{2}}{a \sqrt {a b +b^{2}}}\right ) b^{2}}{2 \sqrt {a b +b^{2}}\, \left (a +b \right ) d \,a^{3}}\) \(699\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(d*x+c)^2/(a+b*sech(d*x+c)^2)^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(2/a^3*(((-5/8*a^2-1/2*a*b)*tanh(1/2*d*x+1/2*c)^7-1/8*a*(15*a^2+15*a*b-4*b^2)/(a+b)*tanh(1/2*d*x+1/2*c)^5-
1/8*a*(15*a^2+15*a*b-4*b^2)/(a+b)*tanh(1/2*d*x+1/2*c)^3+(-5/8*a^2-1/2*a*b)*tanh(1/2*d*x+1/2*c))/(a*tanh(1/2*d*
x+1/2*c)^4+b*tanh(1/2*d*x+1/2*c)^4+2*a*tanh(1/2*d*x+1/2*c)^2-2*b*tanh(1/2*d*x+1/2*c)^2+a+b)^2+1/8*(3*a^2+12*a*
b+8*b^2)/(a+b)*(-1/4/b^(1/2)/(a+b)^(1/2)*ln((a+b)^(1/2)*tanh(1/2*d*x+1/2*c)^2+2*tanh(1/2*d*x+1/2*c)*b^(1/2)+(a
+b)^(1/2))+1/4/b^(1/2)/(a+b)^(1/2)*ln((a+b)^(1/2)*tanh(1/2*d*x+1/2*c)^2-2*tanh(1/2*d*x+1/2*c)*b^(1/2)+(a+b)^(1
/2))))-1/a^3*ln(tanh(1/2*d*x+1/2*c)-1)+1/a^3*ln(tanh(1/2*d*x+1/2*c)+1))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 1255 vs. \(2 (131) = 262\).
time = 0.62, size = 1255, normalized size = 9.03 \begin {gather*} -\frac {{\left (3 \, a^{3} + 30 \, a^{2} b + 40 \, a b^{2} + 16 \, b^{3}\right )} \log \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + a + 2 \, b - 2 \, \sqrt {{\left (a + b\right )} b}}{a e^{\left (2 \, d x + 2 \, c\right )} + a + 2 \, b + 2 \, \sqrt {{\left (a + b\right )} b}}\right )}{64 \, {\left (a^{5} + 2 \, a^{4} b + a^{3} b^{2}\right )} \sqrt {{\left (a + b\right )} b} d} + \frac {{\left (3 \, a^{3} + 30 \, a^{2} b + 40 \, a b^{2} + 16 \, b^{3}\right )} \log \left (\frac {a e^{\left (-2 \, d x - 2 \, c\right )} + a + 2 \, b - 2 \, \sqrt {{\left (a + b\right )} b}}{a e^{\left (-2 \, d x - 2 \, c\right )} + a + 2 \, b + 2 \, \sqrt {{\left (a + b\right )} b}}\right )}{64 \, {\left (a^{5} + 2 \, a^{4} b + a^{3} b^{2}\right )} \sqrt {{\left (a + b\right )} b} d} + \frac {5 \, a^{4} + 20 \, a^{3} b + 12 \, a^{2} b^{2} + {\left (5 \, a^{4} + 66 \, a^{3} b + 128 \, a^{2} b^{2} + 64 \, a b^{3}\right )} e^{\left (6 \, d x + 6 \, c\right )} + {\left (15 \, a^{4} + 164 \, a^{3} b + 460 \, a^{2} b^{2} + 512 \, a b^{3} + 192 \, b^{4}\right )} e^{\left (4 \, d x + 4 \, c\right )} + {\left (15 \, a^{4} + 118 \, a^{3} b + 208 \, a^{2} b^{2} + 96 \, a b^{3}\right )} e^{\left (2 \, d x + 2 \, c\right )}}{16 \, {\left (a^{7} + 2 \, a^{6} b + a^{5} b^{2} + {\left (a^{7} + 2 \, a^{6} b + a^{5} b^{2}\right )} e^{\left (8 \, d x + 8 \, c\right )} + 4 \, {\left (a^{7} + 4 \, a^{6} b + 5 \, a^{5} b^{2} + 2 \, a^{4} b^{3}\right )} e^{\left (6 \, d x + 6 \, c\right )} + 2 \, {\left (3 \, a^{7} + 14 \, a^{6} b + 27 \, a^{5} b^{2} + 24 \, a^{4} b^{3} + 8 \, a^{3} b^{4}\right )} e^{\left (4 \, d x + 4 \, c\right )} + 4 \, {\left (a^{7} + 4 \, a^{6} b + 5 \, a^{5} b^{2} + 2 \, a^{4} b^{3}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )} d} - \frac {5 \, a^{4} + 20 \, a^{3} b + 12 \, a^{2} b^{2} + {\left (15 \, a^{4} + 118 \, a^{3} b + 208 \, a^{2} b^{2} + 96 \, a b^{3}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (15 \, a^{4} + 164 \, a^{3} b + 460 \, a^{2} b^{2} + 512 \, a b^{3} + 192 \, b^{4}\right )} e^{\left (-4 \, d x - 4 \, c\right )} + {\left (5 \, a^{4} + 66 \, a^{3} b + 128 \, a^{2} b^{2} + 64 \, a b^{3}\right )} e^{\left (-6 \, d x - 6 \, c\right )}}{16 \, {\left (a^{7} + 2 \, a^{6} b + a^{5} b^{2} + 4 \, {\left (a^{7} + 4 \, a^{6} b + 5 \, a^{5} b^{2} + 2 \, a^{4} b^{3}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + 2 \, {\left (3 \, a^{7} + 14 \, a^{6} b + 27 \, a^{5} b^{2} + 24 \, a^{4} b^{3} + 8 \, a^{3} b^{4}\right )} e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, {\left (a^{7} + 4 \, a^{6} b + 5 \, a^{5} b^{2} + 2 \, a^{4} b^{3}\right )} e^{\left (-6 \, d x - 6 \, c\right )} + {\left (a^{7} + 2 \, a^{6} b + a^{5} b^{2}\right )} e^{\left (-8 \, d x - 8 \, c\right )}\right )} d} - \frac {5 \, a^{3} + 2 \, a^{2} b + {\left (15 \, a^{3} + 32 \, a^{2} b + 8 \, a b^{2}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (15 \, a^{3} + 46 \, a^{2} b + 56 \, a b^{2} + 16 \, b^{3}\right )} e^{\left (-4 \, d x - 4 \, c\right )} + {\left (5 \, a^{3} + 16 \, a^{2} b + 8 \, a b^{2}\right )} e^{\left (-6 \, d x - 6 \, c\right )}}{8 \, {\left (a^{6} + 2 \, a^{5} b + a^{4} b^{2} + 4 \, {\left (a^{6} + 4 \, a^{5} b + 5 \, a^{4} b^{2} + 2 \, a^{3} b^{3}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + 2 \, {\left (3 \, a^{6} + 14 \, a^{5} b + 27 \, a^{4} b^{2} + 24 \, a^{3} b^{3} + 8 \, a^{2} b^{4}\right )} e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, {\left (a^{6} + 4 \, a^{5} b + 5 \, a^{4} b^{2} + 2 \, a^{3} b^{3}\right )} e^{\left (-6 \, d x - 6 \, c\right )} + {\left (a^{6} + 2 \, a^{5} b + a^{4} b^{2}\right )} e^{\left (-8 \, d x - 8 \, c\right )}\right )} d} + \frac {3 \, \log \left (\frac {a e^{\left (-2 \, d x - 2 \, c\right )} + a + 2 \, b - 2 \, \sqrt {{\left (a + b\right )} b}}{a e^{\left (-2 \, d x - 2 \, c\right )} + a + 2 \, b + 2 \, \sqrt {{\left (a + b\right )} b}}\right )}{32 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {{\left (a + b\right )} b} d} + \frac {\log \left (a e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (a + 2 \, b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a\right )}{4 \, a^{3} d} - \frac {\log \left (2 \, {\left (a + 2 \, b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a e^{\left (-4 \, d x - 4 \, c\right )} + a\right )}{4 \, a^{3} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^2/(a+b*sech(d*x+c)^2)^3,x, algorithm="maxima")

[Out]

-1/64*(3*a^3 + 30*a^2*b + 40*a*b^2 + 16*b^3)*log((a*e^(2*d*x + 2*c) + a + 2*b - 2*sqrt((a + b)*b))/(a*e^(2*d*x
 + 2*c) + a + 2*b + 2*sqrt((a + b)*b)))/((a^5 + 2*a^4*b + a^3*b^2)*sqrt((a + b)*b)*d) + 1/64*(3*a^3 + 30*a^2*b
 + 40*a*b^2 + 16*b^3)*log((a*e^(-2*d*x - 2*c) + a + 2*b - 2*sqrt((a + b)*b))/(a*e^(-2*d*x - 2*c) + a + 2*b + 2
*sqrt((a + b)*b)))/((a^5 + 2*a^4*b + a^3*b^2)*sqrt((a + b)*b)*d) + 1/16*(5*a^4 + 20*a^3*b + 12*a^2*b^2 + (5*a^
4 + 66*a^3*b + 128*a^2*b^2 + 64*a*b^3)*e^(6*d*x + 6*c) + (15*a^4 + 164*a^3*b + 460*a^2*b^2 + 512*a*b^3 + 192*b
^4)*e^(4*d*x + 4*c) + (15*a^4 + 118*a^3*b + 208*a^2*b^2 + 96*a*b^3)*e^(2*d*x + 2*c))/((a^7 + 2*a^6*b + a^5*b^2
 + (a^7 + 2*a^6*b + a^5*b^2)*e^(8*d*x + 8*c) + 4*(a^7 + 4*a^6*b + 5*a^5*b^2 + 2*a^4*b^3)*e^(6*d*x + 6*c) + 2*(
3*a^7 + 14*a^6*b + 27*a^5*b^2 + 24*a^4*b^3 + 8*a^3*b^4)*e^(4*d*x + 4*c) + 4*(a^7 + 4*a^6*b + 5*a^5*b^2 + 2*a^4
*b^3)*e^(2*d*x + 2*c))*d) - 1/16*(5*a^4 + 20*a^3*b + 12*a^2*b^2 + (15*a^4 + 118*a^3*b + 208*a^2*b^2 + 96*a*b^3
)*e^(-2*d*x - 2*c) + (15*a^4 + 164*a^3*b + 460*a^2*b^2 + 512*a*b^3 + 192*b^4)*e^(-4*d*x - 4*c) + (5*a^4 + 66*a
^3*b + 128*a^2*b^2 + 64*a*b^3)*e^(-6*d*x - 6*c))/((a^7 + 2*a^6*b + a^5*b^2 + 4*(a^7 + 4*a^6*b + 5*a^5*b^2 + 2*
a^4*b^3)*e^(-2*d*x - 2*c) + 2*(3*a^7 + 14*a^6*b + 27*a^5*b^2 + 24*a^4*b^3 + 8*a^3*b^4)*e^(-4*d*x - 4*c) + 4*(a
^7 + 4*a^6*b + 5*a^5*b^2 + 2*a^4*b^3)*e^(-6*d*x - 6*c) + (a^7 + 2*a^6*b + a^5*b^2)*e^(-8*d*x - 8*c))*d) - 1/8*
(5*a^3 + 2*a^2*b + (15*a^3 + 32*a^2*b + 8*a*b^2)*e^(-2*d*x - 2*c) + (15*a^3 + 46*a^2*b + 56*a*b^2 + 16*b^3)*e^
(-4*d*x - 4*c) + (5*a^3 + 16*a^2*b + 8*a*b^2)*e^(-6*d*x - 6*c))/((a^6 + 2*a^5*b + a^4*b^2 + 4*(a^6 + 4*a^5*b +
 5*a^4*b^2 + 2*a^3*b^3)*e^(-2*d*x - 2*c) + 2*(3*a^6 + 14*a^5*b + 27*a^4*b^2 + 24*a^3*b^3 + 8*a^2*b^4)*e^(-4*d*
x - 4*c) + 4*(a^6 + 4*a^5*b + 5*a^4*b^2 + 2*a^3*b^3)*e^(-6*d*x - 6*c) + (a^6 + 2*a^5*b + a^4*b^2)*e^(-8*d*x -
8*c))*d) + 3/32*log((a*e^(-2*d*x - 2*c) + a + 2*b - 2*sqrt((a + b)*b))/(a*e^(-2*d*x - 2*c) + a + 2*b + 2*sqrt(
(a + b)*b)))/((a^2 + 2*a*b + b^2)*sqrt((a + b)*b)*d) + 1/4*log(a*e^(4*d*x + 4*c) + 2*(a + 2*b)*e^(2*d*x + 2*c)
 + a)/(a^3*d) - 1/4*log(2*(a + 2*b)*e^(-2*d*x - 2*c) + a*e^(-4*d*x - 4*c) + a)/(a^3*d)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 3459 vs. \(2 (131) = 262\).
time = 0.45, size = 7158, normalized size = 51.50 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^2/(a+b*sech(d*x+c)^2)^3,x, algorithm="fricas")

[Out]

[1/16*(16*(a^4*b + 2*a^3*b^2 + a^2*b^3)*d*x*cosh(d*x + c)^8 + 128*(a^4*b + 2*a^3*b^2 + a^2*b^3)*d*x*cosh(d*x +
 c)*sinh(d*x + c)^7 + 16*(a^4*b + 2*a^3*b^2 + a^2*b^3)*d*x*sinh(d*x + c)^8 + 4*(5*a^4*b + 25*a^3*b^2 + 36*a^2*
b^3 + 16*a*b^4 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2*b^3 + 2*a*b^4)*d*x)*cosh(d*x + c)^6 + 4*(5*a^4*b + 25*a^3*b^2 +
 36*a^2*b^3 + 16*a*b^4 + 112*(a^4*b + 2*a^3*b^2 + a^2*b^3)*d*x*cosh(d*x + c)^2 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2
*b^3 + 2*a*b^4)*d*x)*sinh(d*x + c)^6 + 8*(112*(a^4*b + 2*a^3*b^2 + a^2*b^3)*d*x*cosh(d*x + c)^3 + 3*(5*a^4*b +
 25*a^3*b^2 + 36*a^2*b^3 + 16*a*b^4 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2*b^3 + 2*a*b^4)*d*x)*cosh(d*x + c))*sinh(d*
x + c)^5 + 20*a^4*b + 44*a^3*b^2 + 24*a^2*b^3 + 4*(15*a^4*b + 73*a^3*b^2 + 146*a^2*b^3 + 136*a*b^4 + 48*b^5 +
8*(3*a^4*b + 14*a^3*b^2 + 27*a^2*b^3 + 24*a*b^4 + 8*b^5)*d*x)*cosh(d*x + c)^4 + 4*(280*(a^4*b + 2*a^3*b^2 + a^
2*b^3)*d*x*cosh(d*x + c)^4 + 15*a^4*b + 73*a^3*b^2 + 146*a^2*b^3 + 136*a*b^4 + 48*b^5 + 8*(3*a^4*b + 14*a^3*b^
2 + 27*a^2*b^3 + 24*a*b^4 + 8*b^5)*d*x + 15*(5*a^4*b + 25*a^3*b^2 + 36*a^2*b^3 + 16*a*b^4 + 16*(a^4*b + 4*a^3*
b^2 + 5*a^2*b^3 + 2*a*b^4)*d*x)*cosh(d*x + c)^2)*sinh(d*x + c)^4 + 16*(56*(a^4*b + 2*a^3*b^2 + a^2*b^3)*d*x*co
sh(d*x + c)^5 + 5*(5*a^4*b + 25*a^3*b^2 + 36*a^2*b^3 + 16*a*b^4 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2*b^3 + 2*a*b^4)
*d*x)*cosh(d*x + c)^3 + (15*a^4*b + 73*a^3*b^2 + 146*a^2*b^3 + 136*a*b^4 + 48*b^5 + 8*(3*a^4*b + 14*a^3*b^2 +
27*a^2*b^3 + 24*a*b^4 + 8*b^5)*d*x)*cosh(d*x + c))*sinh(d*x + c)^3 + 16*(a^4*b + 2*a^3*b^2 + a^2*b^3)*d*x + 4*
(15*a^4*b + 59*a^3*b^2 + 76*a^2*b^3 + 32*a*b^4 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2*b^3 + 2*a*b^4)*d*x)*cosh(d*x +
c)^2 + 4*(112*(a^4*b + 2*a^3*b^2 + a^2*b^3)*d*x*cosh(d*x + c)^6 + 15*a^4*b + 59*a^3*b^2 + 76*a^2*b^3 + 32*a*b^
4 + 15*(5*a^4*b + 25*a^3*b^2 + 36*a^2*b^3 + 16*a*b^4 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2*b^3 + 2*a*b^4)*d*x)*cosh(
d*x + c)^4 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2*b^3 + 2*a*b^4)*d*x + 6*(15*a^4*b + 73*a^3*b^2 + 146*a^2*b^3 + 136*a
*b^4 + 48*b^5 + 8*(3*a^4*b + 14*a^3*b^2 + 27*a^2*b^3 + 24*a*b^4 + 8*b^5)*d*x)*cosh(d*x + c)^2)*sinh(d*x + c)^2
 + ((3*a^4 + 12*a^3*b + 8*a^2*b^2)*cosh(d*x + c)^8 + 8*(3*a^4 + 12*a^3*b + 8*a^2*b^2)*cosh(d*x + c)*sinh(d*x +
 c)^7 + (3*a^4 + 12*a^3*b + 8*a^2*b^2)*sinh(d*x + c)^8 + 4*(3*a^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^3)*cosh(d*x
 + c)^6 + 4*(3*a^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^3 + 7*(3*a^4 + 12*a^3*b + 8*a^2*b^2)*cosh(d*x + c)^2)*sinh
(d*x + c)^6 + 8*(7*(3*a^4 + 12*a^3*b + 8*a^2*b^2)*cosh(d*x + c)^3 + 3*(3*a^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^
3)*cosh(d*x + c))*sinh(d*x + c)^5 + 2*(9*a^4 + 60*a^3*b + 144*a^2*b^2 + 160*a*b^3 + 64*b^4)*cosh(d*x + c)^4 +
2*(35*(3*a^4 + 12*a^3*b + 8*a^2*b^2)*cosh(d*x + c)^4 + 9*a^4 + 60*a^3*b + 144*a^2*b^2 + 160*a*b^3 + 64*b^4 + 3
0*(3*a^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^3)*cosh(d*x + c)^2)*sinh(d*x + c)^4 + 3*a^4 + 12*a^3*b + 8*a^2*b^2 +
 8*(7*(3*a^4 + 12*a^3*b + 8*a^2*b^2)*cosh(d*x + c)^5 + 10*(3*a^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^3)*cosh(d*x
+ c)^3 + (9*a^4 + 60*a^3*b + 144*a^2*b^2 + 160*a*b^3 + 64*b^4)*cosh(d*x + c))*sinh(d*x + c)^3 + 4*(3*a^4 + 18*
a^3*b + 32*a^2*b^2 + 16*a*b^3)*cosh(d*x + c)^2 + 4*(7*(3*a^4 + 12*a^3*b + 8*a^2*b^2)*cosh(d*x + c)^6 + 15*(3*a
^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^3)*cosh(d*x + c)^4 + 3*a^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^3 + 3*(9*a^4 +
 60*a^3*b + 144*a^2*b^2 + 160*a*b^3 + 64*b^4)*cosh(d*x + c)^2)*sinh(d*x + c)^2 + 8*((3*a^4 + 12*a^3*b + 8*a^2*
b^2)*cosh(d*x + c)^7 + 3*(3*a^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^3)*cosh(d*x + c)^5 + (9*a^4 + 60*a^3*b + 144*
a^2*b^2 + 160*a*b^3 + 64*b^4)*cosh(d*x + c)^3 + (3*a^4 + 18*a^3*b + 32*a^2*b^2 + 16*a*b^3)*cosh(d*x + c))*sinh
(d*x + c))*sqrt(a*b + b^2)*log((a^2*cosh(d*x + c)^4 + 4*a^2*cosh(d*x + c)*sinh(d*x + c)^3 + a^2*sinh(d*x + c)^
4 + 2*(a^2 + 2*a*b)*cosh(d*x + c)^2 + 2*(3*a^2*cosh(d*x + c)^2 + a^2 + 2*a*b)*sinh(d*x + c)^2 + a^2 + 8*a*b +
8*b^2 + 4*(a^2*cosh(d*x + c)^3 + (a^2 + 2*a*b)*cosh(d*x + c))*sinh(d*x + c) + 4*(a*cosh(d*x + c)^2 + 2*a*cosh(
d*x + c)*sinh(d*x + c) + a*sinh(d*x + c)^2 + a + 2*b)*sqrt(a*b + b^2))/(a*cosh(d*x + c)^4 + 4*a*cosh(d*x + c)*
sinh(d*x + c)^3 + a*sinh(d*x + c)^4 + 2*(a + 2*b)*cosh(d*x + c)^2 + 2*(3*a*cosh(d*x + c)^2 + a + 2*b)*sinh(d*x
 + c)^2 + 4*(a*cosh(d*x + c)^3 + (a + 2*b)*cosh(d*x + c))*sinh(d*x + c) + a)) + 8*(16*(a^4*b + 2*a^3*b^2 + a^2
*b^3)*d*x*cosh(d*x + c)^7 + 3*(5*a^4*b + 25*a^3*b^2 + 36*a^2*b^3 + 16*a*b^4 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2*b^
3 + 2*a*b^4)*d*x)*cosh(d*x + c)^5 + 2*(15*a^4*b + 73*a^3*b^2 + 146*a^2*b^3 + 136*a*b^4 + 48*b^5 + 8*(3*a^4*b +
 14*a^3*b^2 + 27*a^2*b^3 + 24*a*b^4 + 8*b^5)*d*x)*cosh(d*x + c)^3 + (15*a^4*b + 59*a^3*b^2 + 76*a^2*b^3 + 32*a
*b^4 + 16*(a^4*b + 4*a^3*b^2 + 5*a^2*b^3 + 2*a*b^4)*d*x)*cosh(d*x + c))*sinh(d*x + c))/((a^7*b + 2*a^6*b^2 + a
^5*b^3)*d*cosh(d*x + c)^8 + 8*(a^7*b + 2*a^6*b^2 + a^5*b^3)*d*cosh(d*x + c)*sinh(d*x + c)^7 + (a^7*b + 2*a^6*b
^2 + a^5*b^3)*d*sinh(d*x + c)^8 + 4*(a^7*b + 4*a^6*b^2 + 5*a^5*b^3 + 2*a^4*b^4)*d*cosh(d*x + c)^6 + 4*(7*(a^7*
b + 2*a^6*b^2 + a^5*b^3)*d*cosh(d*x + c)^2 + (a...

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tanh ^{2}{\left (c + d x \right )}}{\left (a + b \operatorname {sech}^{2}{\left (c + d x \right )}\right )^{3}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)**2/(a+b*sech(d*x+c)**2)**3,x)

[Out]

Integral(tanh(c + d*x)**2/(a + b*sech(c + d*x)**2)**3, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 296 vs. \(2 (131) = 262\).
time = 1.84, size = 296, normalized size = 2.13 \begin {gather*} -\frac {\frac {{\left (3 \, a^{2} + 12 \, a b + 8 \, b^{2}\right )} \arctan \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + a + 2 \, b}{2 \, \sqrt {-a b - b^{2}}}\right )}{{\left (a^{4} + a^{3} b\right )} \sqrt {-a b - b^{2}}} - \frac {2 \, {\left (5 \, a^{3} e^{\left (6 \, d x + 6 \, c\right )} + 20 \, a^{2} b e^{\left (6 \, d x + 6 \, c\right )} + 16 \, a b^{2} e^{\left (6 \, d x + 6 \, c\right )} + 15 \, a^{3} e^{\left (4 \, d x + 4 \, c\right )} + 58 \, a^{2} b e^{\left (4 \, d x + 4 \, c\right )} + 88 \, a b^{2} e^{\left (4 \, d x + 4 \, c\right )} + 48 \, b^{3} e^{\left (4 \, d x + 4 \, c\right )} + 15 \, a^{3} e^{\left (2 \, d x + 2 \, c\right )} + 44 \, a^{2} b e^{\left (2 \, d x + 2 \, c\right )} + 32 \, a b^{2} e^{\left (2 \, d x + 2 \, c\right )} + 5 \, a^{3} + 6 \, a^{2} b\right )}}{{\left (a^{4} + a^{3} b\right )} {\left (a e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} + 4 \, b e^{\left (2 \, d x + 2 \, c\right )} + a\right )}^{2}} - \frac {8 \, {\left (d x + c\right )}}{a^{3}}}{8 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^2/(a+b*sech(d*x+c)^2)^3,x, algorithm="giac")

[Out]

-1/8*((3*a^2 + 12*a*b + 8*b^2)*arctan(1/2*(a*e^(2*d*x + 2*c) + a + 2*b)/sqrt(-a*b - b^2))/((a^4 + a^3*b)*sqrt(
-a*b - b^2)) - 2*(5*a^3*e^(6*d*x + 6*c) + 20*a^2*b*e^(6*d*x + 6*c) + 16*a*b^2*e^(6*d*x + 6*c) + 15*a^3*e^(4*d*
x + 4*c) + 58*a^2*b*e^(4*d*x + 4*c) + 88*a*b^2*e^(4*d*x + 4*c) + 48*b^3*e^(4*d*x + 4*c) + 15*a^3*e^(2*d*x + 2*
c) + 44*a^2*b*e^(2*d*x + 2*c) + 32*a*b^2*e^(2*d*x + 2*c) + 5*a^3 + 6*a^2*b)/((a^4 + a^3*b)*(a*e^(4*d*x + 4*c)
+ 2*a*e^(2*d*x + 2*c) + 4*b*e^(2*d*x + 2*c) + a)^2) - 8*(d*x + c)/a^3)/d

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\mathrm {cosh}\left (c+d\,x\right )}^4\,\left ({\mathrm {cosh}\left (c+d\,x\right )}^2-1\right )}{{\left (a\,{\mathrm {cosh}\left (c+d\,x\right )}^2+b\right )}^3} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(c + d*x)^2/(a + b/cosh(c + d*x)^2)^3,x)

[Out]

int((cosh(c + d*x)^4*(cosh(c + d*x)^2 - 1))/(b + a*cosh(c + d*x)^2)^3, x)

________________________________________________________________________________________